package slidingWindow;

public class InheritanceTest {
    public static void main(String[] args) {
        Goo goo = new Goo();
        Super s = new Sub();
        goo.g(s);
    }
}

class Super {
    public void f() {
        System.out.println("Super.f()");
    }
}

class Sub extends Super {
    @Override
    public void f() {
        System.out.println("Sub.f()");
    }
}

class Goo {
    public void g(Super obj) {
        System.out.println("g(Super)..");
        obj.f();
    }

    public void g(Sub obj) {
        System.out.println("g(Sub)..");
        obj.f();
    }
}
